package com.sky.directdeal.helper;

import android.content.Context;

import com.sky.directdeal.listener.ServiceResponseListener;
import com.sky.directdeal.listener.UiUpdateListener;
import com.sky.directdeal.manager.ServiceManager;
import com.sky.local_ads.fetch_category.CategoryResponse;
import com.sky.local_ads.offer_cat_list.OfferCategoryResponse;

public class HomeActvityHelper {
	
	public static void getTodayDealServiceCall(Context context,final UiUpdateListener uiUpdateListener){
		ServiceManager.getAllOffers(context, new ServiceResponseListener<OfferCategoryResponse>() {
			
			@Override
			public void onSuccess(OfferCategoryResponse response) {
				uiUpdateListener.OnUpdateUI(response);
			}
			
			@Override
			public void onFailure(Throwable throwable, String errorResponse) {
				uiUpdateListener.OnFailure(errorResponse);
				
			}
		});
	}
	
	//getting category list
	public static void getCategoryServiceCall(Context context,final UiUpdateListener uiUpdateListener){
		ServiceManager.getCategoriesList(context, new ServiceResponseListener<CategoryResponse>() {
			
			@Override
			public void onSuccess(CategoryResponse response) {
				uiUpdateListener.OnUpdateUI(response);
			}
			
			@Override
			public void onFailure(Throwable throwable, String errorResponse) {
				uiUpdateListener.OnFailure(errorResponse);
				
			}
		});
	}

}
